#!/usr/bin/python
# -*- coding: UTF-8 -*-

fibo = [1, 2]
i=1
SUM=0

while (fibo[i] < 4000000):
  fibo.append(fibo[i-1]+fibo[i])
  if ( fibo[i]%2 == 0 ):
    SUM+=fibo[i]
  i+=1

print SUM
